﻿local PMEngine, L, PrivateDB, ProfileDB, GlobalDB = unpack(select(2, ...)); 
local RC = PMEngine:GetModule('RaidCooldown')

PMEngine.Options.args.raidcooldown = {
	type = "group",
	name = "RaidCooldown",
	get = function(info) return PMEngine.db.raidcooldown[ info[#info] ] end,
	set = function(info, value) PMEngine.db.raidcooldown[ info[#info] ] = value end,
	args = {
		intro = {
			order = 1,
			type = "description",
			name = "Adjust Raidcooldown settings for PandemoniuMUI.",
		},
		enable = {
			order = 2,
			type = "toggle",
			name = "Enable",
			set = function(info, value) PMEngine.db.raidcooldown.enable = value; StaticPopup_Show("GLOBAL_RL") end,
		},
		castannounce = {
			order = 3,
			type = "toggle",
			name = "Announce Casts",
			set = function(info, value) PMEngine.db.raidcooldown.castannounce = value; end,
		},		
		cdannounce = {
			order = 4,
			type = "toggle",
			name = "Announce CD Expire",
			set = function(info, value) PMEngine.db.raidcooldown.cdannounce = value; end,
		},		
		active = {
			order = 5,
			type = "toggle",
			name = "Activate Active Mode",
			set = function(info, value) PMEngine.db.raidcooldown.active = value; StaticPopup_Show("GLOBAL_RL") end,
		},			
		scale = {
			order = 5,
			type = "range",
			name = 'Set Scale',
			desc = "Sets Scale of Raid Cooldowns",
			min = 0.3, max = 2, step = 0.01,
			set = function(info, value) PMEngine.db.raidcooldown.scale = value; RC:Scale(); RC:MoverSize(); end,
        },	
		grow = {
			order = 6,
			name = "Bar Grow Direction",
			type = 'select',
			set = function(info, value) PMEngine.db.raidcooldown.grow = value; StaticPopup_Show("GLOBAL_RL") end,
			values = {
				['left'] = "left",
				['right'] = "right",
			},			
		},		
		type = {
			order = 7,
			name = "Show Option",
			type = 'select',
			set = function(info, value) PMEngine.db.raidcooldown.type = value; StaticPopup_Show("GLOBAL_RL") end,
			values = {
				['always'] = "always",
				['raid'] = "raid",
				['group'] = "group",
			},				
		},
		cooldown = {
			order = 300,
			type = 'group',
			name = 'Raid Cooldowns',
			get = function(info) return PMEngine.db.raidcooldown.cooldown[ info[#info] ] end,
			set = function(info, value) PMEngine.db.raidcooldown.cooldown[ info[#info] ] = value; StaticPopup_Show("CONFIG_RL") end,	
			guiInline = true,
			args = {
				DA = {
					type = 'toggle',
					name = 'Devotion Aura'
				},
				HOS = {
					type = 'toggle',
					name = 'Hand of Sacrifice'
				},
				PWB = {
					type = 'toggle',
					name = "Power Word: Barrier"
				},
				PS = {
					type = 'toggle',
					name = 'Pain Suppression'	
				},
	     		DH = {
	     			type = 'toggle',
	     			name = 'Divine Hymn'
	     		},
	     		GS = {
	     			type = 'toggle',
	     			name = 'Guardian Spirit'
	     		},
				VS = {
					type = 'toggle',
					name = 'Void Shift'
				},
				HH = {
					type = 'toggle',
					name = 'Hymn of Hope'
				},	
				VE = {
					type = 'toggle',
					name = 'Vampiric Embrace'
				},
				T = {
					type = 'toggle',
					name = 'Tranquility'
				},
				FE = {
					type = 'toggle',
					name = 'Ironbark'
				},
				R = {
					type = 'toggle',
					name = 'Rebirth'
				},
				I = {
					type = 'toggle',
					name = 'Innervate'
				},
				SLT = {
					type = 'toggle',
					name = 'Spirit Link Totem'
				},
				MTT = {
					type = 'toggle',
					name = 'Mana Tide Totem'
				},
				HTT = {
					type = 'toggle',
					name = 'Healing Tide Totem'
				},
				ST = {
					type = 'toggle',
					name = 'Stormlash Totem'
				},
				AG = {
					type = 'toggle',
					name = 'Ancestral Guidance'
				},
				ZEN = {
					type = 'toggle',
					name = 'Zen Meditation'
				},
				LIFE = {
					type = 'toggle',
					name = 'Life Cocoon'
				},
				REV = {
					type = 'toggle',
					name = 'Revival'
				},
	 			SR = {
	 				type = 'toggle',
	 				name = 'Soulstone Resurrection'
	 			},
				RA = {
					type = 'toggle',
					name = 'Raise Ally'
				},
				AMZ = {
					type = 'toggle',
					name = 'Anti-Magic Zone'
				},
	     		RC = {
	     			type = 'toggle',
	     			name = 'Rallying Cry'
	     		},
				DB = {
					type = 'toggle',
					name = 'Demoralizing Banner'
				}
			},		
		},
	},
}